'plugin api

type tool
    use as sub ( byval i as fb.image ptr, byval x as integer, byval y as integer, byval color_ as integer, byval state as tool ptr )
    single_action as sub ( byval i as fb.image ptr, byval pcol as integer, byval acol as integer, byval state as tool ptr )
    multi_action as sub ( byval i as ext.gfx.sprite ptr, byval i_len as uinteger, byval pcol as integer, byval acol as integer, byval state as tool ptr )

    destroy as sub ( byval state as tool ptr )
    as string toolname
    as tool ptr this_ 'points to this, passed as state arg
    as any ptr state_
    as fb.image ptr toolbox '48x48
    as ext.gfx.sprite ptr cursor 'center of mouse is located @ 4x4 in the loaded sprite no matter the size
    declare constructor
    declare destructor
end type

type IO
    extension as string
    save as function ( byval i as fb.image ptr, byref fn as string ) as integer
    load as function ( byref fn as string ) as fb.image ptr
end type

enum Supports
    pTool = 1
    pIO = 2
    pToolandIO = 4
end enum

type init_tool_ as function ( ) as tool ptr
type init_IO_ as function ( ) as IO ptr
type init_plugin_ as function ( ) as Supports
